<?php	include $_SERVER['DOCUMENT_ROOT'] . "/assets/includes/session.php"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>Wake Forest School of Law</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="keywords" content="wake forest university school of law,wfu,law,law school,jd program,jd/mba program,llm program,sjd program,north carolina,winston-salem,top law school" />
		<meta name="description" content="Ranked one of the top law schools in the country, located in Winston-Salem, NC that offers JD, JD/MBA, LLM, and SJD degree programs." />

		<?php
			$layout = '2col';
			include $_SERVER['DOCUMENT_ROOT'] . "/assets/includes/head.php"; 
		?>
		<link href='/assets/css/local.css' rel='stylesheet' type='text/css' media='screen' />
		<script type="text/javascript" src="/assets/jQuery/jquery-1.3.1.js"></script>

		<style type="text/css">
			.homeprofileitem h1{
				font-size: 20px;
			}
			
			#orientation h3{
				font-family: "Times New Roman";
				margin: 15px 0 5px 0;
				padding: 0;
			}
			#orientation a{
				text-decoration: none;
				color: #9e7e38;
				border-bottom: 1px solid #c1b58a;
			}
			#orientation a:hover{
				color: #c1b58a;
				border-bottom: 1px solid #e7dcba;
			}
			#orientation p{
				margin: 0;
				padding: 0;
				font-size: 12px;
				line-height: 16px;
			}
			.homeprofileitem{
				position: relative;
				padding: 20px 20px 20px 20px;
				margin: 10px 0;
				border-right: 1px solid #c1b58a;
				border-left: 1px solid #c1b58a;
			}
			.p1{
				margin-left: 550px;
			}
			.hidden{
				display:none;
			}
			img{
				border: none;
			}
			
			
			#container{
				background-image: none;
			}
			#homecontent{
				margin: 10px 10px;
			}
			h3{
				font-size: 19px;
				font-weight: normal;
				padding: 5px 0 0 0;
				margin-top: 0;
				margin-bottom: 10px;
				color: #717171;
				border-bottom: 2px solid #c0c0c0;
			}
			#col1{
				background-color: #f1f1f1;
				width: 200px;
				margin: 10px;
				display: inline;
				float: left;
				position: relative;
				padding: 0 10px 15px 10px;
			}
			#col1 ul{
				list-style: none;
				margin: 0;
				padding: 0;
			}
			#col1 li{
				clear: both;
				padding: 10px 0 0 0;
				border-bottom: 1px dashed #c0c0c0;
			}
			#col1 a{
				text-decoration: none;
			}
			
			
			#col2{
				width: 220px;
				margin: 10px;
				display: inline;
				float: left;
				position: relative;
			}
			#col2 ul{
				list-style: none;
				margin: 0 0 25px 0;
				padding: 0;
			}
			#col2 li{
				clear: both;
				padding: 15px 0 0 0;
			}
			.headline{
				font-size: 12px;
				margin: 0;
				padding: 0;
			}
			.release{
				font-size: 12px;
				margin: 0;
				padding: 0 0 0 15px;
				color: #808080;
			}
			#col2 .more{
				right: 0;
			}

			
			#col3{
				width: 220px;
				margin: 0;
				padding: 10px 9px 10px 10px;
				display: inline;
				float: left;
				position: relative;
				border-right: 1px dotted #c0c0c0;
				border-right: none;
			}
			#col3 ul{
				list-style: none;
				margin: 0 0 25px 0;
				padding: 0;
			}
			#col3 li{
				clear: both;
				padding: 15px 0 0 0;
			}
			.when{
				float: left;
				display: inline;
				position: relative;
				width: 50px;
				text-align: center;
				text-transform: uppercase;
				color: #808080;
				margin: 0;
				padding: 0 8px 0 0;
				border-right: 2px solid #c0c0c0;
			}
			.details{
				width: 155px!important;
				width: 150px;
				color: #808080;
				margin: 0 0 0 65px;
				padding: 0;
				font-size: 12px;
			}
			.month{
				display: block;
			}
			.day{
				display: block;
				font-size: 22px;
			}
			.time{
				display: block;
				font-size: 10px;
				margin: 0;
			}
			.postponed{
				color: #82231c;
				font-weight: bold;
			}
			.more{
				display:block;
				font-size: 11px;
				margin-top: 1px !important;
				margin-top: 22px;
				position: absolute;
				width: 100%;
				text-align: right;
				right: 10px;		
			}
			.more a{
				text-decoration: none;
			}
			#col4{
				width: 220px;
				margin: 10px;
				display: inline;
				float: left;
				position: relative;
			}
			#socialmedia{
				background-color: #f1f1f1 !important;
				background-color: #d9e9e9;
				display:block;
				position: relative;
				padding: 0 10px 5px 10px;
				margin: 0 0 25px 0;
			}
			.cooltoday{
				padding: 5px;
				margin: 0 0 25px 0;
				border: 1px solid #dcdcdc;
			}
			
			
			.main{
				overflow: hidden;
				margin: 20px auto;
				padding: 1px 0 21px 0;
				width: 940px;
				height: 300px;
				position: relative;
				border-top: 2px solid #c0c0c0;
				border-bottom: 2px solid #c0c0c0;
			}
			.billboard{
				position:absolute;
				display:none;
			}
			.billboardtop{
				position:absolute;
				display:inline;
			}
			#indicators{
				background-color: #232323;
				width: 900px;
				padding: 10px 20px;
				position: absolute;
				bottom: 1px;
				left: 0;
			}
			.indicator{
				background-image: url(/assets/images/newhome/empty.gif);
				background-repeat: no-repeat;
				background-position: bottom;
				margin: 0 5px 0 0;
				padding: 5px;
				/* border: 1px solid #dcdcdc; */
				float: left;
			}
			.indicatorselected{
				background-image: url(/assets/images/newhome/full.gif);
				/*background-color: #dcdcdc; */
			}
		</style>
		
		<script type="text/javascript">
			var timer="";
			var clickedElement="";
			var currentElement="";
			
			function rotate(){						
				//Get the currrent image
				var current = $('.billboard:visible:last').attr("src");
				
				//Get the last image
				var last = $('.billboard:last').attr("src");
				
				if(current == last){
					$('.billboard:not(:last)').hide();
					$('.billboard:first').show();
					$('.billboard:last').fadeOut("slow");
					$('.indicator:last').toggleClass("indicatorselected");
					$('.indicator:first').toggleClass("indicatorselected");
				}else{
					$('.billboard:hidden:first').fadeIn("slow");
					$('.indicatorselected + .indicator').toggleClass("indicatorselected");
					$('.indicatorselected:first').toggleClass("indicatorselected");
				}
			};
			
			
  			$(document).ready(function () {
  				timer = setInterval('rotate()', 8000);
  				
  				$('.main').hover(
  					function(){
  						clearInterval(timer);
  					},
  					function(){
  						timer = setInterval('rotate()', 8000);
  					}
  				);
  				
  				$('.indicator').click(function(){
  					clearInterval(timer);
					
					//find current element
					$('.indicator').each(function(index){
						if($(this).is(".indicatorselected")) {
							currentElement = parseInt(index);
						}
					});
					
					//move indicator
					$('.indicatorselected').removeClass("indicatorselected");
					$(this).addClass("indicatorselected");
  					 
  					//find selected element  					
					$('.indicator').each(function(index){
						if($(this).is(".indicatorselected")) {
							clickedElement = parseInt(index);
						}
					});
					
					//display selected element
					if(clickedElement > currentElement){
						$('.billboard:eq(' + clickedElement + ')').fadeIn("slow", function(){
							$('.billboard:lt(' + clickedElement + ')').show();
						});
					}
					if(clickedElement < currentElement){
						$('.billboard:lt(' + currentElement + ')').hide();
						$('.billboard:lt(' + clickedElement + ')').show();
						$('.billboard:eq(' + clickedElement + ')').show();
						$('.billboard:eq(' + currentElement + ')').fadeOut("slow");
					}
  				});
   	 		});
		</script>
	</head>
	<body>
		<?php	include $_SERVER['DOCUMENT_ROOT'] . "/assets/includes/header.php"; ?>
		<div class="main">
			<a href="/news/spotlight/exoneree/" title="read this story" ><img class="billboard billboardtop" src="/assets/images/newhome/billboard.exoneree.jpg" alt="" /></a>
			<a href="/news/spotlight/helenjugovic/" title="read this story" ><img class="billboard" src="/assets/images/newhome/billboard.helenjugovic.jpg" alt="" /></a>
			<a href="/news/spotlight/nafta/" title="read this story" ><img class="billboard" src="/assets/images/newhome/billboard.nafta.jpg" alt="" /></a>
			<a href="/news/spotlight/bolton/" title="read this story" ><img class="billboard" src="/assets/images/newhome/billboard.bolton.jpg" alt="" /></a>
			<a href="/news/spotlight/lloydrector/" title="read this story" ><img class="billboard" src="/assets/images/newhome/billboard.ring.jpg" alt="" /></a>
			<a href="/news/spotlight/habitat/" title="read this story" ><img class="billboard" src="/assets/images/newhome/billboard.habitat.jpg" alt="" /></a>	
			<div id="indicators">
				<div class="indicator indicatorselected"></div>
				<div class="indicator"></div>
				<div class="indicator"></div>
				<div class="indicator"></div>
				<div class="indicator"></div>
				<div class="indicator"></div>
			</div>
		</div>        
        <div id="homecontent">
        	<div id="col1">
        		<h3>Resources</h3>
        		<ul>
        			<li><a href="/academics/">Academics</a></li>
        			<li><a href="/admissions/">Admissions</a></li>
        			<li><a href="/career/">Career Services</a></li>
        			<li><a href="/clinics/">Clinics &amp; Field Work</a></li>
        			<li><a href="/faculty/">Faculty</a></li>
        			<li><a href="/alumni/giving/">Giving</a></li>
        			<li><a href="http://pcl.wfu.edu/">Library</a></li>
        			<li><a href="/news/">News &amp; Events</a></li>
        			<li><a href="/studentlife/">Student Life</a></li>
        		</ul>
        	</div>
        	<div id="col3">
        		<h3>Events Calendar<span class='more'><a href="/calendar/">see all events &raquo;</a></span></h3>
				<ul>
				    <?php
						include $_SERVER['DOCUMENT_ROOT'] . "/calendar/calendar.parser.php"; 
				    	$xmlbase = "http://web.wfu.edu/lawcalendar/xml/";
				    	$calname = "law";	
				    	$calauth = "a86aec1ad2a3a4599878985266864e3a";
				    ?>
						
					<?php 
						$thisyear = date('Y');
						$thismonth = date('n');
						$thisday = date('j');
						
						$enddate = strtotime("+5 month -1 day");
						$endyear = date('Y', $enddate);
						$endmonth = date('n', $enddate);
						$endday = date('j', $enddate);
						
						$xmlquery = "&startyear=$thisyear&startmonth=$thismonth&startday=$thisday&endyear=$endyear&endmonth=$endmonth&endday=$endday&return=7";
						$xmlurl = "$xmlbase?auth=$calauth&calendar=$calname$xmlquery";							
						
						//create cache file (if doesn't exist) from XML feed 
						$xmlCacheFilename = $_SERVER['DOCUMENT_ROOT'] ."/home/cache/newhome.calendar.cache";
						$cachetime = 60*3; //seconds to keep cache file - 3 minutes
						
						if(file_exists($xmlCacheFilename) && time() - $cachetime < filemtime($xmlCacheFilename)){
							//open the cache file and unserialize the data
							$fp = fopen($xmlCacheFilename, "r");
							$data = fread($fp, filesize($xmlCacheFilename));
							$calitem = unserialize($data);
							fclose($fp);
						}else{
							//get xml feed
							$calitem = parseUrl($xmlurl);
							
							//put serialized data into cache file
							$fp = fopen($xmlCacheFilename, "w");
							$data = serialize($calitem);
							fwrite($fp, $data);
							fclose($fp);
						}
					?>
    				<?php if($calitem->eventCount > 0): ?>
    						<?php
    							$count=0;
    							foreach($calitem->event as $event){
    								if($count++ < 10){
										//make some of the data ready for the screen							
										if($event[start] == '00:00' AND $event[end] == '23:59'){
											$startTime = 'All day';
										}else{
											$startTime = $event[startTime];
										}
										
										if($event[status] == "Postponed"){
											$status = "<br /><span class='postponed'>** Postponed **</span>";
										}else{
											$status = "";
										}
	    								
									echo "<li>";
									echo "<p class='when'><span class='month'>" . date('M', mktime(0,0,0,$event[month],$event[day],$event[year])) . "</span><span class='day'>" . $event[day] . "</span><span class='time'>$startTime</span></p>";
									echo "<p class='details'><a href='/calendar/$event[year]/$event[month]/$event[day]/$event[eventId]/'>" . $event[title] . "</a><br />" . $event[location] . "$status</p>";
									echo "</li>";
	    								
	    								
    								}
    							}
    						?>
					<?php endif; ?>
				</ul>
        	</div>
        	<div id="col2">
        		<h3>Recent News<span class='more'><a href="/news/">see all news &raquo;</a></span></h3>
				<ul>
					<?php	
						$newsitems = GetHomeNews();
						while ($newsitem = mysql_fetch_array($newsitems)) {
							$filename = $newsitem['news_url'];
							$result_array = explode('.', $filename);
							$newsdate = $result_array[0] . '-' . $result_array[1] . '-' . $result_array[2];
							
							
							$newsitempath =	 $_SERVER['DOCUMENT_ROOT'] . '/news/release/' . $newsitem['news_url'];
							$newsitemlink = "/news/release/" . $newsitem['news_url'];

							echo "<li>";
								echo "<p class='headline'><a href='$newsitemlink'>" . GetTitle($newsitempath) . "</a></p>";
								echo "<p class='release'>Release date: " . date('M j', strtotime($newsdate)) . "</p>";
							echo "</li>";
						
						}
					?>
				</ul>
        		    
    
        		<h3>In the Media<span class='more'><a href="/news/media/">see all in the media &raquo;</a></span></h3>
				<ul>
				
				<?php
					$mediaitems = GetMedia(3);
					while($mediaitem = mysql_fetch_array($mediaitems)){
						$linktext = $mediaitem['linktext'];
						$url = htmlentities($mediaitem['url']);
						$date = $mediaitem['date'];
						$about = $mediaitem['about'];
						$name = $mediaitem['name'];
						$fname = $mediaitem['fname'];
						$lname = $mediaitem['lname'];
						$username = $mediaitem['username'];
	
						if($about != 0){
							$name = profilename($username);
						}
						
						if($url == ''){
							$link = "$linktext";
						}else{
							$link = "<a href='$url'>$linktext</a>";
						}
						echo "<li>";
							echo "<p class='headline'>$link</p>";
							echo "<p class='release'>$name<br />Release date: " . date('M j', strtotime($date)) . "</p>";
						echo "</li>";
						
					}
				?>
				</ul>

        	</div>
        	<div id="col4">
        		<div id="socialmedia">
	        		<h3>Follow Wake Law on:</h3>
	        		<a href="http://www.facebook.com/pages/Winston-Salem-NC/Wake-Forest-University-School-of-Law/47809854792" title="facebook"><img src="/assets/images/newhome/icons/points/48x48/facebook.png" alt="visit wake law on facebook" /></a> <a href="http://twitter.com/WFULawSchool" title="twitter"><img src="/assets/images/newhome/icons/points/48x48/twitter.png" alt="visit wake law on twitter" /></a><a href="http://www.flickr.com/photos/wfulawschool" title="flickr"><img src="/assets/images/newhome/icons/points/48x48/flickr.png" alt="visit wake law on flickr" /></a> <a href="http://blogs.law.wfu.edu/" title="blogs"><img src="/assets/images/newhome/icons/points/48x48/blog.png" alt="view the Wake Law blogs"/></a> 
        		</div>
        		<h3>Start your journey today</h3>
	        	<a href="/admissions/apply/" title="apply now"><img src="/assets/images/newhome/ad.apply.jpg" alt="apply online" class="cooltoday" /></a> 
        		<h3>Be a superhero</h3>
	        	<a href="/probono/" title="Pro bono"><img src="/assets/images/newhome/ad.probono.jpg" alt="be a superhero" class="cooltoday" /></a> 
        		
        		<!-- <h3>Your gifts at work</h3>
	        	<a href="/alumni/giving/" title="make a gift"><img src="/assets/images/newhome/ad.giving.jpg" alt="make a gift" class="cooltoday" /></a> --> 
        	</div>
        </div>
		<?php	include $_SERVER['DOCUMENT_ROOT'] . "/assets/includes/footer.php"; ?>
</body>
</html>
